<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ include file="../../Include/Config.jsp"%>
<html>
<head>
<title>Web Ram Program</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="ram/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript">
    $(function(){

    	<logic:messagesPresent message="true">
    	  <html:messages message="true" id="msg">
    	    var msgs = '<bean:write name="msg" />'; 
	        msgs = msgs.replace(/\?/g, '');
	        msgs = msgs.replace(/en_US./g, '');
	        msgs = msgs.replace(/ko_KR./g, '');
            if(msgs.search("성공") > 0){
            	alert(msgs);
                location.href="project.do?proId=${sessionScope.unitIDInSession}";
            }
    	  </html:messages>
        </logic:messagesPresent>

        $("img#updateImg").css("cursor","pointer").click(function(){

            var proIterNum = $("#proIterNum").val();
            if(proIterNum == "" || proIterNum == undefined ){
                alert("시뮬레이터 횟수를 입력하세요");
                $("#proIterNum").focus();
                return false;
             }
            var proStartTime = $("#proStartTime").val();
            if(proStartTime == "" || proStartTime == undefined ){
                alert("시뮬레이터 시작일을 입력해 주세요.");
                $("#proStartTime").focus();
                return false;
             }            
            var proLifeTime = $("#proLifeTime").val();
            if(proLifeTime == "" || proLifeTime == undefined ){
                alert("운영시간을 입력해 주세요.");
                $("#proLifeTime").focus();
                return false;
             }            
            var proTd = $("#proTd").val();
            if(proTd == "" || proTd == undefined ){
                alert("시간 분할값을 입력해 주세요.");
                $("#proTd").focus();
                return false;
             }
            if(confirm("저장하시겠습니까?")){
                $("form")[0].submit();
            }
        });
    });    
    </script>
</head> 
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
     <form name="smsForm" method="post" action="project-submit.do" onsubmit="return false;">
      <input type="hidden" name="method" value="simulationUpdate" />
     <input type="hidden" name="proId" value="${sessionScope.unitIDInSession}" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr> 
        <td height="60">
          <!----- header ----------->
          <jsp:include page="../../Include/Header.jsp"></jsp:include>
          <!----- header end ----------->
        </td>
      </tr>
      <tr>
        <td>            
          <div align="left">
            <table width="1251" border="0" cellpadding="0" cellspacing="0">
              <tr valign="top">
                <td width="180" height="473">
                  <%@ include file="../../Include/Project_Left.jsp"%>
                </td>
                <td width="20">&nbsp;</td>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td>
                        <!----<table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td><img src="../images/title_member01.jpg" width="161" height="30"></td>
                            <td height="30" align="center" bgcolor="#333333">
                              <font color="#FFFFFF">
                                <strong>
                                </strong>
                              </font>
                              <font color="#FFFFFF">
                                <strong>Simulation&nbsp;값</strong>
                              </font>
                            </td>
                          </tr>
                          <tr>
                            <td height="1" bgcolor="f44901"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#f4f4f4">
                              <table width="100%" border="0" cellspacing="0" cellpadding="10">
                                <tr>
      								<td valign="top">
          									<table width="100%" border="0" cellspacing="0" cellpadding="0">
              									<tr>
                                                  <td height="22">ㆍSimulator 등록 페이지 입니다.</td>
                                               </tr>
                                          </table>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>--->
                     <img src="ram/images/simulation-reg.jpg"> </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                     <td height="25"> 
						 <table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="30"><font color="ff3300"><b>기본정보</b></font></td>
						    </tr>
						   <tr>
						    <td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
								  <tr>
								      <td bgcolor="#DDDDDD">
								          <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
								              <tr>
								                  <td width="768" height="30" bgcolor="#f4f4f4" colspan="2">
								                          <p><strong>Setting</strong></p>
								                  </td>
								              </tr>
								              <html:hidden property="proUid" name="projectForm"/>
								              <tr>
								                  <td height="30" bgcolor="#f4f4f4" width="164">Iteration Num</td>
								                  <td height="30" bgcolor="#FFFFFF" width="593">
								                    <p>
								                      <html:text property="proIterNum"  styleId="proIterNum" name="projectForm" styleClass="grayform" size="10" />
								                    </p>                     
								                  </td>
								               </tr>
								              <tr>
												<td height="30" bgcolor="#f4f4f4" width="164">Starting time of Simulation</td>
												<td width="593" height="30" bgcolor="#FFFFFF">        
								                  <p>
								                    <html:text property="proStartTime"  styleId="proStartTime" name="projectForm" styleClass="grayform" size="10" />
								                  </p>
								                </td>
								              </tr>
								              <tr>
								 			    <td height="30" bgcolor="#f4f4f4" width="164">Life time</td>
												<td height="14" bgcolor="#FFFFFF" width="593">
								                  <p>
								                    <html:text property="proLifeTime"  styleId="proLifeTime" name="projectForm" styleClass="grayform" size="10" />
								                  </p>                
								                </td>
								              </tr>
												<tr>
												<td height="30" bgcolor="#f4f4f4" width="164"># of time division/year</td>
												<td height="15" bgcolor="#FFFFFF" width="593">
												  <p>
												    <html:text property="proTd"  styleId="proTd" name="projectForm" styleClass="grayform" size="10" />
												  </p>
												</td>
								              </tr>
                                          </table>
                                       </td>
                                </tr>
                              </table>
                           </td>
                        </tr>
						<tr>
                           <td height="50" align="center"><img id="updateImg" src="ram/images/btn_edit.jpg" border="0"></td>
                        </tr>
                        <tr>
    						<td>&nbsp;</td>
                         </tr>
                       </table>                                            
                       <p>&nbsp;</p>
                      </td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                  <p>&nbsp;</p>
                </td>
              </tr>
            </table>
          </div>
        </td>
      </tr>
      <tr>
        <td align="center">
          <%@ include file="../../Include/Foot.jsp"%>
        </td>
      </tr>
    </table>
    </form>
  </body>
</html>